package com.brillilab.service.core.plans;

import java.util.Date;
import java.util.List;

import com.brillilab.domain.po.plans.Plan;
import com.brillilab.domain.vo.plans.PlanVo;

/**
 * <p>
 * 计划实验表 服务类
 * </p>
 *
 * @author zlb
 * @since 2019-09-05
 */
public interface IPlanService  {
    Plan insert(Plan plan);

    boolean updateById(Plan plan);

    boolean deleteById(Long id, Long labId);

    Plan selectById(Long id);

    /**
     * 获取成员Id在指定时间区间的计划列表
     * @param labMemberId
     * @param startTime
     * @param endTime
     * @return
     */
    List<Plan> getPlanList(Long labMemberId, Date startTime, Date endTime);

    /**
     * 获取成员Id集合在指定时间区间的计划列表
     * @param labMemberIdList
     * @param startTime
     * @param endTime
     * @return
     */
    List<Plan> getPlanListByLabMemberIdList(List<Long> labMemberIdList, String startDate, String endDate);

	List<Plan> getPlanListByTargetGroupId(Long targetGroupId);

    List<Plan> selectListByLabMemberId(Long labMemberId);

    /**
     * 获取实验流分组最新一次计划实验
     * @param targetGroupId
     * @return
     */
	List<Plan> getNewPlanList(Long targetGroupId);

	Plan getPlanByExperimentId(Long experimentId);

	/**
	 * 计划列表
	 * @param labMemberId
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	List<PlanVo> getPlanVoList(Long labMemberId, String startDate, String endDate);

	void deleteByExperimentGroupId(Long experimentGroupId);
	
	void deleteByTopicExperimentId(Long topicExperimentId);
	/**
	 * 获取实验流分组中未完成数
	 * @param topicTargetId
	 * @return
	 */
	int getNoCompleteNum(Long topicTargetId);
	
	/**
	 * 判断是否可添加到计划
	 * @param topicTargetId
	 * @return
	 */
	boolean isAddPlan(Long topicTargetId);

	void deleteByTopicId(Long topicId);

	void deleteByTopicDirectionId(Long topicDirectionId);

	void deleteByTopicTargetId(Long topicTargetId);

	void deleteByTargetGroupId(Long targetGroupId);

	/**
	 * 获取实验流分组中我的未完成数
	 * @param topicTargetId
	 * @return
	 */
	int getMeNoCompleteNum(Long topicTargetId, Long labMemberId);

	/**
	 * 今日未完成计划列表
	 * @param labMemberId
	 * @return
	 */
	List<Plan> getTodayPlanNoCompleteList(Long labMemberId);

	List<Plan> getPlanListByPlanTime(Long labMemberId, Date planTime);
	/**
	 * 返回未使用的计划时间
	 * @param labMemberId
	 * @param planTime
	 * @param num 加减小时数
	 * @return
	 */
	Date getPlanTime(Long labMemberId, Date planTime, int num);
	/**
	 * 获取最新一个计划
	 * @param targetGroupId
	 * @return
	 */
	Plan getNewestPlan(Long targetGroupId);

	void deleteByExperimentId(Long experimentId);


}
